<!DOCTYPE html>
<!-- saved from url=(0052)http://getbootstrap.com/docs/4.0/examples/dashboard/ -->
<html lang="en" xmlns:th="http://www.thymeleaf.org">

<head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
    <meta name="description" content="">
    <meta name="author" content="">

    <title>Dashboard Template for Bootstrap</title>
    <!-- Bootstrap core CSS -->
    <link th:href="@{/css/bootstrap.min.css}" rel="stylesheet">

    <!-- Custom styles for this template -->
    <link th:href="@{/css/dashboard.css}" rel="stylesheet">
    <style type="text/css">
        /* Chart.js */

        @-webkit-keyframes chartjs-render-animation {
            from {
                opacity: 0.99
            }
            to {
                opacity: 1
            }
        }

        @keyframes chartjs-render-animation {
            from {
                opacity: 0.99
            }
            to {
                opacity: 1
            }
        }

        .chartjs-render-monitor {
            -webkit-animation: chartjs-render-animation 0.001s;
            animation: chartjs-render-animation 0.001s;
        }
    </style>
</head>

<body>
<div th:replace="~{/commons/common::headBar}"></div>

<div class="container-fluid">
    <div class="row">
        <div th:replace="~{/commons/common::sideBar(active='paper.html')}"></div>

        <main role="main" class="col-md-9 ml-sm-auto col-lg-10 pt-3 px-4">
            <h2>试卷列表</h2>
            <div class="row">
                <div class="col-lg-6">
                    <h4><a class="btn btn-sm btn-success" th:href="@{/exam/edit}">添加试卷</a></h4>
                </div><!-- /.col-lg-6 -->
                <div class="col-lg-6">
                    <form th:action="@{/exam/searchsubmit}" method="get">
                        <table>
                            <tr>
                                <td>
                                    <input name="name" type="text" class="form-control" placeholder="输入标题查询">
                                </td>
                                <td>
                                    <span class="input-group-btn">
                                    <button class="btn btn-default" type="submit">Go!</button>
                                    </span>
                                </td>
                            </tr>
                        </table>
                    </form>
                </div><!-- /input-group -->
            </div>


            <div class="table-responsive">
                <table class="table table-striped table-sm">
                    <thead>
                    <tr>
                        <th>考试名称</th>
                        <th>指定班级</th>
                        <th>开始时间</th>
                        <th>结束时间</th>
                        <th>考试时长</th>
                        <th>总分</th>
                        <th>操作</th>
                    </tr>
                    </thead>
                    <tbody>
                    <tr th:each="exam:${page.records}">
                        <td th:text="${exam.getTitle()}"></td>
                        <td th:text="${exam.getClassName()}"></td>
                        <td th:text="${#dates.format(exam.getStartTime(),'yyyy-MM-dd HH:mm')}"></td>
                        <td th:text="${#dates.format(exam.getEndTime(),'yyyy-MM-dd HH:mm')}"></td>
                        <td th:text="${exam.getTotalTime()}==0?'不限时':${exam.getTotalTime()}+'分钟'"></td>
                        <td th:text="${exam.getTotalScore()}"></td>
                        <td>
                            <a class="btn btn-sm btn-primary" th:href="@{/exam/edit/}+${exam.getId()}">编辑</a>
                            <a class="btn btn-sm btn-info" th:href="@{/qu/list/}+${exam.getId()}">查看题目</a>
                            <a class="btn btn-sm btn-danger" th:href="@{/exam/del/}+${exam.getId()}">删除</a>
                        </td>
                    </tr>
                    </tbody>
                </table>
                <div th:replace="~{/commons/page::page}"></div><!--将分页的页面包含-->
            </div>
        </main>
    </div>
</div>

</body>

</html>